<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8" >
    <title>user setting</title>
<style>
.sidebar {
    float: left;
    width: 10%;
    height: 100%;
    background-color: #f1f1f1;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    padding: 10px;
    border-bottom: 1px solid #ccc;
}

.sidebar li a {
    color: #000;
    text-decoration: none;
}

.content {
    float: right;
    width: 80%;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
}
</style>    
</head>
<body>
    <div class="sidebar">
        <ul>
			<li><a href="mqttSetting">MQTT</a></li>
            <li><a href="userSetting">USER</a></li>
            <li><a href="deviceInfo">DEVICE</a></li>
        </ul>
    </div>
    <div class="content">
        <form name="passwordForm">
        <table align="left">
        <caption>密码修改<caption/>
            <tr>
            <tr>
                <td>新密码:</td>
                <td>
                    <input type="password" name="newPassword" maxlength = "20" placeholder="Enter new password">
                </td>
            </tr>
            <tr>
                <td>再次输入:</td>
                <td>
                    <input type="password" name="againPassword" maxlength = "20" placeholder="Enter again password">
                </td>
            </tr>
            <tr>
            <td colspan="2" style="text-align: center; padding: 5px;">
                <input type="button" value="保存" onclick="submitForm()"/>
            </tr>
        </table>
        </form>
    </div>
</body>
<script>
    function submitForm()
    {
        if( !passwordForm.newPassword.value )
        {
            alert("密码不能为空");
			passwordForm.newPassword.focus();
             return;           
        }
        if(passwordForm.newPassword.value != passwordForm.againPassword.value )
        {
			passwordForm.againPassword.focus();
            alert("两次密码不同");
            return;
        }
        passwordForm.method = 'POST';
        passwordForm.action = "/userPasswordSave";
        passwordForm.submit();
    }
</script>
</html>